package com.iuie.ns.system.vo.code;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 码值类型
 * @author lj
 * @createTime 2017年1月18日 上午9:40:34
 */
@Table(name="SYS_CODE_TYPE")
@Entity
public class SysCodeTypeVO {
	
	@Id
	@Column(name="CODE_TYPE_ID",length=32)
	private String codeTypeId    ; // 码值类型编号
	
	@Column(name="CODE_TYPE_NAME",length=128)
	private String codeTypeName  ; // 码值类型名称
	
	@Column
	private Integer state ; // 启用状态
	
	@OneToMany(fetch=FetchType.LAZY,
			cascade={CascadeType.REMOVE},
			mappedBy="codeType")
	private Set<SysCodeInfoVO> codeInfos = new HashSet<SysCodeInfoVO>();

	/**
	 * @return the codeTypeId
	 */
	public String getCodeTypeId() {
		return codeTypeId;
	}

	/**
	 * @param codeTypeId the codeTypeId to set
	 */
	public void setCodeTypeId(String codeTypeId) {
		this.codeTypeId = codeTypeId;
	}

	/**
	 * @return the codeTypeName
	 */
	public String getCodeTypeName() {
		return codeTypeName;
	}

	/**
	 * @param codeTypeName the codeTypeName to set
	 */
	public void setCodeTypeName(String codeTypeName) {
		this.codeTypeName = codeTypeName;
	}

	/**
	 * @return the state
	 */
	public Integer getState() {
		return state;
	}

	/**
	 * @param state the state to set
	 */
	public void setState(Integer state) {
		this.state = state;
	}

	/**
	 * @return the codeInfos
	 */
	public Set<SysCodeInfoVO> getCodeInfos() {
		return codeInfos;
	}

	/**
	 * @param codeInfos the codeInfos to set
	 */
	public void setCodeInfos(Set<SysCodeInfoVO> codeInfos) {
		this.codeInfos = codeInfos;
	}

	@Override
	public String toString() {
		return "SysCodeTypeVO [codeTypeId=" + codeTypeId + ", codeTypeName=" + codeTypeName + ", state=" + state + ", codeInfos=" + codeInfos + "]";
	}

	
}
